package org.gdstash.db;

public class ItemSlots implements Cloneable {
    public boolean slotAxe1H;
    public boolean slotAxe2H;
    public boolean slotDagger1H;
    public boolean slotMace1H;
    public boolean slotMace2H;
    public boolean slotScepter1H;
    public boolean slotSpear1H;
    public boolean slotSpear2H;
    public boolean slotStaff2H;
    public boolean slotSword1H;
    public boolean slotSword2H;
    public boolean slotRanged1H;
    public boolean slotRanged2H;
    public boolean slotShield;
    public boolean slotOffhand;
    public boolean slotAmulet;
    public boolean slotBelt;
    public boolean slotMedal;
    public boolean slotRing;
    public boolean slotHead;
    public boolean slotShoulders;
    public boolean slotChest;
    public boolean slotHands;
    public boolean slotLegs;
    public boolean slotFeet;

    public ItemSlots clone() {
        final ItemSlots slots = new ItemSlots();
        slots.slotAxe1H = this.slotAxe1H;
        slots.slotAxe2H = this.slotAxe2H;
        slots.slotDagger1H = this.slotDagger1H;
        slots.slotMace1H = this.slotMace1H;
        slots.slotMace2H = this.slotMace2H;
        slots.slotScepter1H = this.slotScepter1H;
        slots.slotSpear1H = this.slotSpear1H;
        slots.slotSpear2H = this.slotSpear2H;
        slots.slotStaff2H = this.slotStaff2H;
        slots.slotSword1H = this.slotSword1H;
        slots.slotSword2H = this.slotSword2H;
        slots.slotRanged1H = this.slotRanged1H;
        slots.slotRanged2H = this.slotRanged2H;
        slots.slotShield = this.slotShield;
        slots.slotOffhand = this.slotOffhand;
        slots.slotAmulet = this.slotAmulet;
        slots.slotBelt = this.slotBelt;
        slots.slotMedal = this.slotMedal;
        slots.slotRing = this.slotRing;
        slots.slotHead = this.slotHead;
        slots.slotShoulders = this.slotShoulders;
        slots.slotChest = this.slotChest;
        slots.slotHands = this.slotHands;
        slots.slotLegs = this.slotLegs;
        slots.slotFeet = this.slotFeet;
        return slots;
    }

    public boolean usesSlots() {
        return this.slotAxe1H || this.slotAxe2H || this.slotDagger1H || this.slotMace1H || this.slotMace2H || this.slotScepter1H || this.slotSpear1H || this.slotSpear2H || this.slotStaff2H || this.slotSword1H || this.slotSword2H || this.slotRanged1H || this.slotRanged2H || this.slotShield || this.slotOffhand || this.slotAmulet || this.slotBelt || this.slotMedal || this.slotRing || this.slotHead || this.slotShoulders || this.slotChest || this.slotHands || this.slotLegs || this.slotFeet;
    }

    public boolean usesAllArmor() {
        final boolean all = this.slotBelt && this.slotHead && this.slotShoulders && this.slotChest && this.slotHands && this.slotLegs && this.slotFeet;
        return all;
    }

    public boolean usesAllWeapons() {
        final boolean all = this.usesMeleeWeapons() && this.usesRangedWeapons();
        return all;
    }

    public boolean usesMeleeWeapons() {
        final boolean all = this.slotAxe1H && this.slotAxe2H && this.slotDagger1H && this.slotMace1H && this.slotMace2H && this.slotScepter1H && this.slotSword1H && this.slotSword2H;
        return all;
    }

    public boolean usesRangedWeapons() {
        final boolean all = this.slotRanged1H && this.slotRanged2H;
        return all;
    }

    public boolean uses1HWeapons() {
        final boolean all = this.slotAxe1H && this.slotDagger1H && this.slotMace1H && this.slotScepter1H && this.slotSword1H && this.slotRanged1H;
        return all;
    }

    public boolean uses2HWeapons() {
        final boolean all = this.slotAxe2H && this.slotMace2H && this.slotSword2H && this.slotRanged2H;
        return all;
    }

    public void clear() {
        this.clearAllArmor();
        this.clearAllWeapons();
    }

    public void clearAllArmor() {
        this.slotBelt = false;
        this.slotHead = false;
        this.slotShoulders = false;
        this.slotChest = false;
        this.slotHands = false;
        this.slotLegs = false;
        this.slotFeet = false;
    }

    public void clearAllWeapons() {
        this.clearMeleeWeapons();
        this.clearRangedWeapons();
    }

    public void clearMeleeWeapons() {
        this.slotAxe1H = false;
        this.slotAxe2H = false;
        this.slotDagger1H = false;
        this.slotMace1H = false;
        this.slotMace2H = false;
        this.slotScepter1H = false;
        this.slotSword1H = false;
        this.slotSword2H = false;
    }

    public void clearRangedWeapons() {
        this.slotRanged1H = false;
        this.slotRanged2H = false;
    }

    public void clear1HWeapons() {
        this.slotAxe1H = false;
        this.slotDagger1H = false;
        this.slotMace1H = false;
        this.slotScepter1H = false;
        this.slotSword1H = false;
        this.slotRanged1H = false;
    }

    public void clear2HWeapons() {
        this.slotAxe2H = false;
        this.slotMace2H = false;
        this.slotSword2H = false;
        this.slotRanged2H = false;
    }
}
